<!DOCTYPE html>
<html lang="en" ng-app ="smartOlwApp">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>Nucleos Educativos</title>
		<link rel="stylesheet" type="text/css" href="../../css/smart_icons_styles.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_menu.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_general.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_tabladatos.css">
	  	
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog.css">
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-default.css">
		<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-plain.css">
	  	
        <!-- Importarmos angular JS -->
        <script type="text/javascript" src="../../js/jquery/jquery-1.8.3.min.js"></script>
    	<script type="text/javascript" src="../../js/main/template.js"></script>
    	<script type="text/javascript" src="../../js/angular-1.4.7/angular.min.js"></script>
    	<script type="text/javascript" src="../../js/ngdialog-0.2.3/ngDialog.min.js"></script> 
    	
    	<!-- importar script para las funciones del formulario -->
    	
		<script type="text/javascript" src="../smart_maestros/script/maestro_app.js"></script>
		<script type="text/javascript" src="../smart_maestros/script/maestro_service.js"></script>
		<script type="text/javascript" src="../smart_personas/script/persona_controller.js"></script>
    	<script type="text/javascript" src="script/nucleosedu_controller.js"></script>
		
</head>
<body ng-controller="nucleoseduCtrl">
		<div class="col-md-10" id="frame">
		<div class="panel panel-primary ng-scope">
   
		    <div class="panel-heading">Nucleos Educativos
		 	<a href="#"><span class="img"><img src="../../imagene/eliminar.png" style="float:right;"  ng-click="eliminar(nucleo)" title = "Eliminar Nucleos Educativos"></span></a>
		 	<a href="#"><span class="img"><img src="../../imagene/limpiar.png" style="float:right;"   ng-click="limpiar(nucleo)" title= "Limpiar"></span></a>
		 	<a href="#"><span class="img"><img src="../../imagene/consultar.png" style="float:right;" ng-click="consultar(nucleo)" title= "Consultar Nucleos Educativos"></span></a>
		 	<a href="#"><span class="img"><img src="../../imagene/guardar.png" style="float:right;"   ng-click="grabar(nucleo)" title= "Guardar Nucleos Educativos"></span></a>
		  </div>
		  <div class="panel-body">
		   <input id="scnucleoeducativo" type="text" class="texto" ng-model="nucleo.scnucleoeducativo" style = "display:none;">
               
                <div class = "alert alert-danger alert-dismissable" id="messageBox">
                	<h4>{{titulo_mensajes}}</h4> {{descripcion_mensajes}}
                	<a href="#"><span class="imagen"><img src="../../imagene/bombilla-incandescente32.png"  ng-click="showModal()"></span></a>
				</div>
					<div class="col-md-10 panel panel-primary ng-scope" style="height:150px;">
						<table style="width:100%; vertical-align: middle;">
									<tr style = "vertical-align: middle;">
										<td style="width:25%; vertical-align: middle;">
											<label  class="label">País*</label><br/>
											<select id="scpais" class="seleccion" ng-model="scpais" ng-options="option.scpais as option.dspais for option in paises" ng-change="cargarDepartamentos()">
											</select>
										</td>
										<td style="width:25%; vertical-align: middle;">
											<label  class="label">Departamento*</label><br/>
											<select id="dsdepartamento" class="seleccion" ng-model="dsdepartamento" ng-options="option.scdepartamento as option.dsdepartamento for option in departamentos" ng-change="cargarCiudades()">
											</select>
										</td>
										<td style="width:25%; vertical-align: middle;">
											<label  class="label">Ciudad*</label><br/>
											<select id="ciudaddto" class="seleccion" ng-model="nucleo.ciudaddto" ng-options="option.scciudad as option.dsciudad for option in ciudades">
											</select>
										</td>
										<td width="25%" height="100%">
										<label class="label" for="Nombre">Código*</label><br/>	
										<input id="dscodigo" type="text" ng-keypress="filterValue($event)" placeholder="Ingrese codigo Nucleos Educativos" class="texto" ng-model="nucleo.conucleoeducativo">
										</td>	
									</tr>
									<tr>
										<td width="25%" height="100%">
											<label class="label" >Nombre*</label><br/>	
											<input id="dsnombre" type="text" placeholder="Ingrese Nucleos Educativos" class="texto" ng-model="nucleo.dsnucleoeducativo">
										</td>
										<td width="25%" height="100%">
											<label class="label" >Identificación director del nucleo *</label><br/>	
											<input id="dsdirector" type="text" placeholder="Ingrese Nucleos Educativos" class="texto" ng-model="directorcel" key-enter="buscarDirector()">
											<a href="" ng-click="buscarDirector()">Buscar</a>
										</td>
										<td width="25%" height="100%">
											<label class="label" >Director*</label><br/>	
											<input id="dsdirector" type="text" placeholder="Ingrese Nucleos Educativos" class="texto" ng-model="directornombre" readonly="true">
										</td>
									</tr>
						</table>
					</div>
					<div class="container">				
					<table class = "tabledatos">
							<thead>
								<tr>
									<th style="width: 150px;" scope="col" >País</th>
									<th style="width: 350px;" scope="col" >Departamento</th>
									<th style="width: 250px;" scope="col" >Ciudad</th>
									<th style="width: 150px;" scope="col" >Código</th>
									<th style="width: 350px;" scope="col" >Nombre</th>
									<th style="width: 250px;" scope="col" >Director</th>
									<th style="width: 50px;" scope="col" >Acción</th>
								</tr>
							</thead>
							<tbody class="tbody">
							
								<tr ng-show="nucleos.length == 0">
									<th colspan="7" style="text-align:center;">
										No se encontraron nucleos educativos
									</th>
								</tr>
							
								<tr ng-repeat="d in nucleos | orderBy : 'dsnucleoeducativo'">

										<td style="width: 150px;">
										  {{d.ciudaddto.departamentodto.scpais.dspais}}
										</td>
										<td style="width: 350px;">
										  {{d.ciudaddto.departamentodto.dsdepartamento}}
										</td>		
										<td style="width: 250px;">
										  {{d.ciudaddto.dsciudad}}
										</td>
										<td style="width: 150px;">
										  {{d.conucleoeducativo}}
										</td>
										<td style="width: 350px;">
										  {{d.dsnucleoeducativo}}
										</td>		
										<td style="width: 250px;">
										  {{d.director.dspnombre}} {{d.director.dssnombre}} {{d.director.dspapellido}} {{d.director.dssapellido}}
										</td>
										<td class="botonera-table" style="width: 50px;">
										<a href="#"><span class="img"><img src="../../imagene/verifique-signo24.png" style="float:center;" ng-click="seleccionar(d)" title ="Editar"></span></a>
										</td>						
								</tr>
							</tbody>
						</table>
						</div>
  
  </div>
</div> 
</div>
</body>
</html>